package cn.hxth.dubbo.customer.controller;

import cn.hxth.api.model.Remind;
import cn.hxth.api.query.PageResult;
import cn.hxth.api.query.QueryObject;
import cn.hxth.api.service.IRemindService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/pages/remind/")
@RestController
public class RemindController {
    @Resource
    private IRemindService remindService ;
    @RequestMapping("updateRemind")
    public  boolean updateRemind( Remind remind){
        return  this.remindService.updateRemind(remind) ;
    }
    @RequestMapping("deleteRemind")
    public  boolean deleteRemind(int sid){
        return  this.remindService.deleteRemind(sid) ;
    }
    @RequestMapping("insertRemind")
    public  boolean insertRemind(@RequestBody Remind remind){
        return  this.remindService.insertRemind(remind) ;
    }
    @RequestMapping("remindList")
    public PageResult remindList(QueryObject queryObject){
        return  this.remindService.findAll(queryObject) ;
    }
    @RequestMapping("getRemindForMq")
   public Remind getRemindForMq(int sid){
        return  this.remindService.getRemindBySid(sid) ;
   }
   // 用于更新警告商品库存表库存信息(发送mq时使用)
   @RequestMapping("updateRemindCount")
   public boolean updateRemindCount(@RequestBody Remind remind){
       return  this.remindService.updateCountBySid(remind) ;
   }
}
